@extends('admin.common.web')

@section('title','分类添加')

@section('content')
<!-- Page Content -->
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <a href="#">系统</a>
            </li>
            <li>
                <a href="#">文章分类管理</a>
            </li>
            <li class="active">添加文章分类</li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->
    <!-- Page Body -->
    <div class="page-body">

        <div class="row">
            <div class="col-lg-12 col-sm-12 col-xs-12">
                <div class="widget">
                    <div class="widget-header bordered-bottom bordered-blue">
                        <span class="widget-caption">新增文章分类</span>
                    </div>
                    <div class="widget-body">
                        <div id="horizontal-form">
                            @include('admin.common.msg')
                            @include('admin.common.error')
                            <form class="form-horizontal" action="{{ route('admin.category.store') }}" method="post">
                                @csrf
                                <div class="form-group">
                                    <label for="group_id" class="col-sm-2 control-label no-padding-right">上级分类</label>
                                    <div class="col-sm-6">
                                        <select name="pid" style="width: 100%;">
                                            <option value="0">顶级分类</option>
                                            @foreach($categoryList as $k => $v)
                                                <option value="{{ $v['id'] }}"><?php echo str_repeat('----',$v['level'])?>{{ $v['category_name'] }}</option>
                                            @endforeach
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="username" class="col-sm-2 control-label no-padding-right">分类名称</label>
                                    <div class="col-sm-6">
                                        <input class="form-control" value="{{ old('category_name') }}" name="category_name" required type="text">
                                    </div>
                                    @if($errors->has('category_name'))
                                        <p class="help-block col-sm-4 blue">{{ $errors->first('category_name') }}</p>
                                    @else
                                        <p class="help-block col-sm-4 red">* 必填</p>
                                    @endif
                                </div>


                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <button type="submit" class="btn btn-info">保存信息</button>
                                        <a href="JavaScript:window.history.go(-1);" class="btn btn-default">返回</a>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <!-- /Page Body -->
@endsection